perm filename GRAPIN.SAI[PIC,HE] blob sn#430326 filedate 1979-04-01 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00002 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	This file simulates tektronix calls. This is the WAITS
C00005 ENDMK
C⊗;
comment This file simulates tektronix calls. This is the WAITS
	version of gabbrv.sai;

require "ddhdr.sai[gra,hpm]" source_file;

real curx,cury; comment the current cursor position;
integer CHAN;

internal procedure movea (real y,x);
begin 
	curx←x; cury←y;
end;


internal procedure drawa (real y,x);
comment Draws line from current cursor position to x,y;
begin
	line(curx,cury,x,y);
	curx←x; cury←y;
	dpyup(CHAN);
end;

internal procedure pointa(real y,x);
comment Writes a dot;
begin
	dot(x,y);
	dpyup(CHAN);
end;

internal procedure dasha (real y,x);
comment Draws dashed line from current cursor position;
begin
	comment For now, this only produced a line;
	drawa(x,y);
end;

internal procedure putext (string str);
begin
	real xlo,ylo,xhi,yhi;
	screem(xlo,ylo,xhi,yhi);
	txtpos(curx,cury,(6.0/512.0)*(xhi-xlo),(12.0/481.0)*(ylo-yhi));
	textd(str);
	dpyup(CHAN);
end;

internal procedure pctr (integer origin);
	ddinit;

internal procedure initt (integer size);
begin
	CHAN←gddchn(-1);
	print("channel number",CHAN);
	erase(CHAN);
	showa(CHAN);
end;

internal procedure endpct;
begin
	rddchn(CHAN);
end;

internal procedure vwindo (real xorg,xsize,yorg,ysize);
	screen(xorg,yorg,xorg+xsize,yorg+ysize);